#include <fstream>
#include <string>
#include "expression.h"

using std::string;

std::ifstream input("in.txt");
std::ofstream output("out.txt");

int main()
{
	string expr;
	while (getline(input, expr))
	{
		try
		{
			output << calculator(expr) << "\n";
		}
		catch (std::exception e)
		{
			output << "<error>\n";
		}
	}
	return 0;
}
